import React, {useEffect, useState} from "react";
import {Button} from 'antd';
import styles from "./index.less";
import homeApi from "../../api";
import {Navigate, useNavigate} from 'react-router-dom'


export default () => {

    const navigate = useNavigate()
    // 已经登陆过 禁止跳转登录页
    console.log(localStorage.getItem('token'), '====login')

    if (localStorage.getItem('token') === 'true') return <Navigate to={'/home'} replace/>

    return (
        <Button type="primary" onClick={() => {
            localStorage.setItem('token', true)
            navigate('/home')
        }}>点击登录</Button>
    )
}